
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Sqlite命令函数 · EasyClick开发文档</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="ui-custom.html" />
    
    
    <link rel="prev" href="shell-api.html" />
    

    
        <link rel="shortcut icon" href="/zh-cn/images/ico.png" type="image/x-icon">
    
    
    
    
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="/zh-cn/images/ico.png">
    
    
        
    
    
        
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../features.html">
            
                <a href="../features.html">
            
                    
                    特性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../changelog.html">
            
                <a href="../changelog.html">
            
                    
                    更改记录
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../getting-start.html">
            
                <a href="../getting-start.html">
            
                    
                    开始
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <a target="_blank" href="https://www.bilibili.com/video/bv1W54y1Q7JG">
            
                    
                    视频教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="devtools/dev-tools.html">
            
                <a href="devtools/dev-tools.html">
            
                    
                    开发工具介绍
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="devtools/dev-tools-install.html">
            
                <a href="devtools/dev-tools-install.html">
            
                    
                    安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="devtools/dev-tools-project.html">
            
                <a href="devtools/dev-tools-project.html">
            
                    
                    工程相关
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="devtools/dev-tools-device.html">
            
                <a href="devtools/dev-tools-device.html">
            
                    
                    设备相关
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="devtools/dev-tools-screen.html">
            
                <a href="devtools/dev-tools-screen.html">
            
                    
                    屏幕相关
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="devtools/dev-tools-settings.html">
            
                <a href="devtools/dev-tools-settings.html">
            
                    
                    设置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../funcs.html">
            
                <a href="../funcs.html">
            
                    
                    功能函数
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="global/global.html">
            
                <a href="global/global.html">
            
                    
                    全局模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="global/global-shortcut.html">
            
                <a href="global/global-shortcut.html">
            
                    
                    全局快捷事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="global/selector-node.html">
            
                <a href="global/selector-node.html">
            
                    
                    选择器&节点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="acevent-api.html">
            
                <a href="acevent-api.html">
            
                    
                    无障碍事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="event-api.html">
            
                <a href="event-api.html">
            
                    
                    代理事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="image-api.html">
            
                <a href="image-api.html">
            
                    
                    图色函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.7" data-path="device-api.html">
            
                <a href="device-api.html">
            
                    
                    设备函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.8" data-path="file-api.html">
            
                <a href="file-api.html">
            
                    
                    文件函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.9" data-path="http-api.html">
            
                <a href="http-api.html">
            
                    
                    网络函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.10" data-path="thread-api.html">
            
                <a href="thread-api.html">
            
                    
                    线程函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.11" data-path="utils-api.html">
            
                <a href="utils-api.html">
            
                    
                    常用工具函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.12" data-path="shell-api.html">
            
                <a href="shell-api.html">
            
                    
                    Shell命令函数
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.7.13" data-path="sqlite-api.html">
            
                <a href="sqlite-api.html">
            
                    
                    Sqlite命令函数
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="ui-custom.html">
            
                <a href="ui-custom.html">
            
                    
                    原生UI定制
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="ui-js-inter.html">
            
                <a href="ui-js-inter.html">
            
                    
                    JS编写UI
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="ui-js-template.html">
            
                <a href="ui-js-template.html">
            
                    
                    模板式UI
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="ui-native-view.html">
            
                <a href="ui-native-view.html">
            
                    
                    原生UI控件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.3.1" data-path="ui/linearlayout.html">
            
                <a href="ui/linearlayout.html">
            
                    
                    LinearLayout线性布局
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.2" data-path="ui/framelayout.html">
            
                <a href="ui/framelayout.html">
            
                    
                    FrameLayout帧布局
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.3" data-path="ui/relativelayout.html">
            
                <a href="ui/relativelayout.html">
            
                    
                    RelativeLayout绝对布局
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.4" data-path="ui/scrollview.html">
            
                <a href="ui/scrollview.html">
            
                    
                    ScrollView滚动框
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.5" data-path="ui/view.html">
            
                <a href="ui/view.html">
            
                    
                    View视图
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.6" data-path="ui/button.html">
            
                <a href="ui/button.html">
            
                    
                    Button按钮
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.7" data-path="ui/textview.html">
            
                <a href="ui/textview.html">
            
                    
                    TextView文本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.8" data-path="ui/edittext.html">
            
                <a href="ui/edittext.html">
            
                    
                    EditText输入框
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.9" data-path="ui/checkbox.html">
            
                <a href="ui/checkbox.html">
            
                    
                    CheckBox复选框
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.10" data-path="ui/radiogroup.html">
            
                <a href="ui/radiogroup.html">
            
                    
                    RadioGroup布局
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.11" data-path="ui/radiobutton.html">
            
                <a href="ui/radiobutton.html">
            
                    
                    RadioButton单选框
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.12" data-path="ui/spinner.html">
            
                <a href="ui/spinner.html">
            
                    
                    Spinner下拉选择框
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.13" data-path="ui/webview.html">
            
                <a href="ui/webview.html">
            
                    
                    WebView内嵌浏览器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.14" data-path="ui/imageview.html">
            
                <a href="ui/imageview.html">
            
                    
                    ImageView图像
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.15" data-path="ui/cardview.html">
            
                <a href="ui/cardview.html">
            
                    
                    CardView卡片布局
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.16" data-path="ui/switch.html">
            
                <a href="ui/switch.html">
            
                    
                    Swtich开关按钮
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="html-ui-custom.html">
            
                <a href="html-ui-custom.html">
            
                    
                    H5 UI定制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../hot-update.html">
            
                <a href="../hot-update.html">
            
                    
                    热更新功能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../zk/zk.html">
            
                <a href="../zk/zk.html">
            
                    
                    企业版中控接口
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../zk/zk-ec-state.html">
            
                <a href="../zk/zk-ec-state.html">
            
                    
                    EC状态控制接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../zk/zk-node.html">
            
                <a href="../zk/zk-node.html">
            
                    
                    全局节点模块接口
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.2.1" data-path="../zk/global/zk-global-log.html">
            
                <a href="../zk/global/zk-global-log.html">
            
                    
                    日志接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.2" data-path="../zk/global/zk-node-service.html">
            
                <a href="../zk/global/zk-node-service.html">
            
                    
                    节点服务接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.3" data-path="../zk/global/zk-global-click.html">
            
                <a href="../zk/global/zk-global-click.html">
            
                    
                    点击动作接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.4" data-path="../zk/global/zk-global-multitouch.html">
            
                <a href="../zk/global/zk-global-multitouch.html">
            
                    
                    多点触摸动作接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.5" data-path="../zk/global/zk-global-swipe.html">
            
                <a href="../zk/global/zk-global-swipe.html">
            
                    
                    滑动动作接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.6" data-path="../zk/global/zk-global-drag.html">
            
                <a href="../zk/global/zk-global-drag.html">
            
                    
                    拖动动作接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.7" data-path="../zk/global/zk-global-input.html">
            
                <a href="../zk/global/zk-global-input.html">
            
                    
                    输入动作接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.8" data-path="../zk/global/zk-global-node.html">
            
                <a href="../zk/global/zk-global-node.html">
            
                    
                    节点操作接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.9" data-path="../zk/global/zk-global-systemkey.html">
            
                <a href="../zk/global/zk-global-systemkey.html">
            
                    
                    系统按键接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.10" data-path="../zk/global/zk-global-notice.html">
            
                <a href="../zk/global/zk-global-notice.html">
            
                    
                    通知栏接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.11" data-path="../zk/global/zk-global-floatview.html">
            
                <a href="../zk/global/zk-global-floatview.html">
            
                    
                    悬浮窗接口
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../zk/zk-agent.html">
            
                <a href="../zk/zk-agent.html">
            
                    
                    代理事件模块接口 - 开发中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.4" data-path="../zk/zk-image.html">
            
                <a href="../zk/zk-image.html">
            
                    
                    图色模块接口 - 开发中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.5" data-path="../zk/zk-device.md">
            
                <span>
            
                    
                    设备模块接口 - 开发中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.6" data-path="../zk/zk-file.md">
            
                <span>
            
                    
                    文件模块接口 - 开发中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.7" data-path="../zk/zk-http.md">
            
                <span>
            
                    
                    网络模块接口 - 开发中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.8" data-path="../zk/zk-utils.md">
            
                <span>
            
                    
                    常用工具模块接口 - 开发中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.9" data-path="../zk/zk-shell.md">
            
                <span>
            
                    
                    Shell命令模块接口 - 开发中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.10" data-path="../zk/zk-sqlite.md">
            
                <span>
            
                    
                    Sqlite模块接口 - 开发中
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="plugin/plugins.html">
            
                <a href="plugin/plugins.html">
            
                    
                    插件开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../question-answer.html">
            
                <a href="../question-answer.html">
            
                    
                    常见问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../agreement.html">
            
                <a href="../agreement.html">
            
                    
                    用户协议
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../declare.html">
            
                <a href="../declare.html">
            
                    
                    免责声明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16" >
            
                <span>
            
                    
                    技术交流 QQ群：777164022
            
                </span>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >Sqlite命令函数</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon "></span><a href="#&#x8BF4;&#x660E;"><b>1. </b>&#x8BF4;&#x660E;</a></li><li><span class="title-icon "></span><a href="#&#x51FD;&#x6570;"><b>2. </b>&#x51FD;&#x6570;</a></li><ul><li><span class="title-icon "></span><a href="#sqliteconnectorcreatedb-&#x8FDE;&#x63A5;&#x6570;&#x636E;&#x5E93;"><b>2.1. </b>sqlite.connectOrCreateDb &#x8FDE;&#x63A5;&#x6570;&#x636E;&#x5E93;</a></li><li><span class="title-icon "></span><a href="#sqlitecreatetable-&#x521B;&#x5EFA;&#x8868;"><b>2.2. </b>sqlite.createTable &#x521B;&#x5EFA;&#x8868;</a></li><li><span class="title-icon "></span><a href="#sqliteinsert-&#x63D2;&#x5165;&#x6570;&#x636E;"><b>2.3. </b>sqlite.insert &#x63D2;&#x5165;&#x6570;&#x636E;</a></li><li><span class="title-icon "></span><a href="#sqliteupdate-&#x66F4;&#x65B0;&#x6570;&#x636E;"><b>2.4. </b>sqlite.update &#x66F4;&#x65B0;&#x6570;&#x636E;</a></li><li><span class="title-icon "></span><a href="#sqlitequery-&#x67E5;&#x8BE2;&#x6570;&#x636E;"><b>2.5. </b>sqlite.query &#x67E5;&#x8BE2;&#x6570;&#x636E;</a></li><li><span class="title-icon "></span><a href="#sqlitedelete-&#x5220;&#x9664;&#x6570;&#x636E;"><b>2.6. </b>sqlite.delete &#x5220;&#x9664;&#x6570;&#x636E;</a></li><li><span class="title-icon "></span><a href="#sqliteexecsql-&#x6267;&#x884C;sql"><b>2.7. </b>sqlite.execSql &#x6267;&#x884C;sql</a></li><li><span class="title-icon "></span><a href="#sqlitedropdatabase-&#x5220;&#x9664;&#x6570;&#x636E;&#x5E93;"><b>2.8. </b>sqlite.dropDatabase &#x5220;&#x9664;&#x6570;&#x636E;&#x5E93;</a></li><li><span class="title-icon "></span><a href="#sqlitedroptable-&#x5220;&#x9664;&#x8868;"><b>2.9. </b>sqlite.dropTable &#x5220;&#x9664;&#x8868;</a></li><li><span class="title-icon "></span><a href="#sqliteclose-&#x5173;&#x95ED;&#x6570;&#x636E;&#x5E93;&#x94FE;&#x63A5;&#xFF0C;&#x91CA;&#x653E;&#x8D44;&#x6E90;"><b>2.10. </b>sqlite.close &#x5173;&#x95ED;&#x6570;&#x636E;&#x5E93;&#x94FE;&#x63A5;&#xFF0C;&#x91CA;&#x653E;&#x8D44;&#x6E90;</a></li></ul></ul></div><a href="#&#x8BF4;&#x660E;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="&#x8BF4;&#x660E;"><a name="&#x8BF4;&#x660E;" class="anchor-navigation-ex-anchor" href="#&#x8BF4;&#x660E;"><i class="fa fa-link" aria-hidden="true"></i></a>1. &#x8BF4;&#x660E;</h1>
<ul>
<li>sqlite&#x6A21;&#x5757;&#x51FD;&#x6570;&#x4E3B;&#x8981;&#x662F;&#x7528;&#x4E8E;&#x64CD;&#x4F5C;sqlite&#x6570;&#x636E;&#x5E93;</li>
<li>sqlite&#x6A21;&#x5757;&#x7684;&#x5BF9;&#x8C61;&#x524D;&#x7F00;&#x662F;sqlite&#xFF0C;&#x4F8B;&#x5982; sqlite.close()&#x8FD9;&#x6837;&#x8C03;&#x7528;</li>
<li>sqlite &#x6559;&#x7A0B;&#xFF1A;<a href="https://www.runoob.com/sqlite/sqlite-tutorial.html" target="_blank">https://www.runoob.com/sqlite/sqlite-tutorial.html</a></li>
</ul>
<h1 id="&#x51FD;&#x6570;"><a name="&#x51FD;&#x6570;" class="anchor-navigation-ex-anchor" href="#&#x51FD;&#x6570;"><i class="fa fa-link" aria-hidden="true"></i></a>2. &#x51FD;&#x6570;</h1>
<h2 id="sqliteconnectorcreatedb-&#x8FDE;&#x63A5;&#x6570;&#x636E;&#x5E93;"><a name="sqliteconnectorcreatedb-&#x8FDE;&#x63A5;&#x6570;&#x636E;&#x5E93;" class="anchor-navigation-ex-anchor" href="#sqliteconnectorcreatedb-&#x8FDE;&#x63A5;&#x6570;&#x636E;&#x5E93;"><i class="fa fa-link" aria-hidden="true"></i></a>2.1. sqlite.connectOrCreateDb &#x8FDE;&#x63A5;&#x6570;&#x636E;&#x5E93;</h2>
<ul>
<li>&#x521B;&#x5EFA;&#x6216;&#x8005;&#x94FE;&#x63A5;&#x4E00;&#x4E2A;&#x6570;&#x636E;&#x5E93;</li>
<li>@param dbName &#x6570;&#x636E;&#x5E93;&#x540D;&#x79F0;</li>
<li>@return boolean true &#x4EE3;&#x8868;&#x8BF7;&#x6C42;&#x6743;&#x9650;&#x6210;&#x529F;&#xFF0C;false&#x4EE3;&#x8868;&#x5931;&#x8D25;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>)</span>{
    <span class="hljs-keyword">var</span> create = sqlite.connectOrCreateDb(<span class="hljs-string">&quot;test.db&quot;</span>);
    logd(<span class="hljs-string">&quot;create db result&#xFF1A;&quot;</span>+create);
}
main();
</code></pre>
</blockquote>
<h2 id="sqlitecreatetable-&#x521B;&#x5EFA;&#x8868;"><a name="sqlitecreatetable-&#x521B;&#x5EFA;&#x8868;" class="anchor-navigation-ex-anchor" href="#sqlitecreatetable-&#x521B;&#x5EFA;&#x8868;"><i class="fa fa-link" aria-hidden="true"></i></a>2.2. sqlite.createTable &#x521B;&#x5EFA;&#x8868;</h2>
<ul>
<li>&#x521B;&#x5EFA;&#x6570;&#x636E;&#x8868;</li>
<li>@param tableName &#x8868;&#x540D;&#x79F0;</li>
<li>@param columns &#x5217;&#x540D;&#x79F0;&#xFF0C;&#x4F8B;&#x5982; [&quot;name&quot;,&quot;pwd&quot;]</li>
<li>@return boolean true &#x4EE3;&#x8868;&#x8BF7;&#x6C42;&#x6743;&#x9650;&#x6210;&#x529F;&#xFF0C;false&#x4EE3;&#x8868;&#x5931;&#x8D25;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>)</span>{
    <span class="hljs-keyword">var</span> tableName=<span class="hljs-string">&quot;tbl_user&quot;</span>;
    <span class="hljs-keyword">var</span> columns=[<span class="hljs-string">&quot;name&quot;</span>,<span class="hljs-string">&quot;pwd&quot;</span>];
    <span class="hljs-keyword">var</span> createTable = sqlite.createTable(tableName,columns);
    logd(<span class="hljs-string">&quot;createTable result&#xFF1A;&quot;</span>+createTable);
}
main();
</code></pre>
</blockquote>
<h2 id="sqliteinsert-&#x63D2;&#x5165;&#x6570;&#x636E;"><a name="sqliteinsert-&#x63D2;&#x5165;&#x6570;&#x636E;" class="anchor-navigation-ex-anchor" href="#sqliteinsert-&#x63D2;&#x5165;&#x6570;&#x636E;"><i class="fa fa-link" aria-hidden="true"></i></a>2.3. sqlite.insert &#x63D2;&#x5165;&#x6570;&#x636E;</h2>
<ul>
<li>&#x63D2;&#x5165;&#x6570;&#x636E;</li>
<li>@param tableName &#x8868;&#x540D;</li>
<li>@param map &#x6570;&#x636E;&#x7684;map&#x8868;</li>
<li>@return boolean true &#x4EE3;&#x8868;&#x8BF7;&#x6C42;&#x6743;&#x9650;&#x6210;&#x529F;&#xFF0C;false&#x4EE3;&#x8868;&#x5931;&#x8D25;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>)</span>{
    <span class="hljs-keyword">var</span> tableName=<span class="hljs-string">&quot;tbl_user&quot;</span>;
    <span class="hljs-keyword">var</span> map={
            <span class="hljs-string">&quot;name&quot;</span>:<span class="hljs-string">&quot;&#x6211;&#x662F;&#x540D;&#x79F0;&quot;</span>,
            <span class="hljs-string">&quot;pwd&quot;</span>:<span class="hljs-string">&quot;&#x6211;&#x662F;&#x5BC6;&#x7801;&quot;</span>
            };
    <span class="hljs-keyword">var</span> insert = sqlite.insert(tableName,map);
    logd(<span class="hljs-string">&quot;insert result&#xFF1A;&quot;</span>+insert);
}
main();
</code></pre>
</blockquote>
<h2 id="sqliteupdate-&#x66F4;&#x65B0;&#x6570;&#x636E;"><a name="sqliteupdate-&#x66F4;&#x65B0;&#x6570;&#x636E;" class="anchor-navigation-ex-anchor" href="#sqliteupdate-&#x66F4;&#x65B0;&#x6570;&#x636E;"><i class="fa fa-link" aria-hidden="true"></i></a>2.4. sqlite.update &#x66F4;&#x65B0;&#x6570;&#x636E;</h2>
<ul>
<li>&#x66F4;&#x65B0;&#x6570;&#x636E;</li>
<li>@param tablename &#x8868;&#x540D;&#x79F0;</li>
<li>@param map &#x6570;&#x636E;&#x7684;map&#x8868;</li>
<li>@param where &#x6761;&#x4EF6;&#x8BED;&#x53E5;</li>
<li>@return boolean true &#x4EE3;&#x8868;&#x8BF7;&#x6C42;&#x6743;&#x9650;&#x6210;&#x529F;&#xFF0C;false&#x4EE3;&#x8868;&#x5931;&#x8D25;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>)</span>{
    <span class="hljs-keyword">var</span> tableName=<span class="hljs-string">&quot;tbl_user&quot;</span>;
    <span class="hljs-keyword">var</span> map={
            <span class="hljs-string">&quot;name&quot;</span>:<span class="hljs-string">&quot;&#x6211;&#x662F;&#x540D;&#x79F0;22&quot;</span>
            };
    <span class="hljs-keyword">var</span> where=<span class="hljs-string">&quot;id&gt;3&quot;</span>;
    <span class="hljs-keyword">var</span> update = sqlite.update(tableName,map,where);
    logd(<span class="hljs-string">&quot;update result&#xFF1A;&quot;</span>+update);
}
main();
</code></pre>
</blockquote>
<h2 id="sqlitequery-&#x67E5;&#x8BE2;&#x6570;&#x636E;"><a name="sqlitequery-&#x67E5;&#x8BE2;&#x6570;&#x636E;" class="anchor-navigation-ex-anchor" href="#sqlitequery-&#x67E5;&#x8BE2;&#x6570;&#x636E;"><i class="fa fa-link" aria-hidden="true"></i></a>2.5. sqlite.query &#x67E5;&#x8BE2;&#x6570;&#x636E;</h2>
<ul>
<li>&#x67E5;&#x8BE2;&#x6570;&#x636E;</li>
<li>@param sql sql&#x8BED;&#x53E5;</li>
<li>@return JSON | &#x6570;&#x636E;&#x96C6;&#x5408;&#x5BF9;&#x8C61;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>)</span>{
    <span class="hljs-keyword">var</span> tableName=<span class="hljs-string">&quot;tbl_user&quot;</span>;
    <span class="hljs-keyword">var</span> sql=<span class="hljs-string">&quot;select * from &quot;</span>+tableName;
    <span class="hljs-keyword">var</span> data = sqlite.query(sql);
    logd(<span class="hljs-string">&quot;data result&#xFF1A;&quot;</span>+<span class="hljs-built_in">JSON</span>.stringify(data));
}
main();
</code></pre>
</blockquote>
<h2 id="sqlitedelete-&#x5220;&#x9664;&#x6570;&#x636E;"><a name="sqlitedelete-&#x5220;&#x9664;&#x6570;&#x636E;" class="anchor-navigation-ex-anchor" href="#sqlitedelete-&#x5220;&#x9664;&#x6570;&#x636E;"><i class="fa fa-link" aria-hidden="true"></i></a>2.6. sqlite.delete &#x5220;&#x9664;&#x6570;&#x636E;</h2>
<ul>
<li>&#x5220;&#x9664;&#x6570;&#x636E;</li>
<li>@param sql sql&#x8BED;&#x53E5;</li>
<li>@return boolean true &#x4EE3;&#x8868;&#x8BF7;&#x6C42;&#x6743;&#x9650;&#x6210;&#x529F;&#xFF0C;false&#x4EE3;&#x8868;&#x5931;&#x8D25;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>)</span>{
    <span class="hljs-keyword">var</span> tableName=<span class="hljs-string">&quot;tbl_user&quot;</span>;
    <span class="hljs-keyword">var</span> sql=<span class="hljs-string">&quot;delete from &quot;</span>+tableName+<span class="hljs-string">&quot; where id&gt;3;&quot;</span>;
    <span class="hljs-keyword">var</span> result = sqlite.delete(sql);
    logd(<span class="hljs-string">&quot;delete result&#xFF1A;&quot;</span>+ result);
}
main();
</code></pre>
</blockquote>
<h2 id="sqliteexecsql-&#x6267;&#x884C;sql"><a name="sqliteexecsql-&#x6267;&#x884C;sql" class="anchor-navigation-ex-anchor" href="#sqliteexecsql-&#x6267;&#x884C;sql"><i class="fa fa-link" aria-hidden="true"></i></a>2.7. sqlite.execSql &#x6267;&#x884C;sql</h2>
<ul>
<li>&#x67E5;&#x8BE2;&#x6570;&#x636E;</li>
<li>@param sql sql&#x8BED;&#x53E5;</li>
<li>@return boolean true &#x4EE3;&#x8868;&#x8BF7;&#x6C42;&#x6743;&#x9650;&#x6210;&#x529F;&#xFF0C;false&#x4EE3;&#x8868;&#x5931;&#x8D25;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>)</span>{
    <span class="hljs-keyword">var</span> tableName=<span class="hljs-string">&quot;tbl_user&quot;</span>;
    <span class="hljs-keyword">var</span> sql=<span class="hljs-string">&quot;delete from &quot;</span>+tableName+<span class="hljs-string">&quot; where id&gt;3;&quot;</span>;
    <span class="hljs-keyword">var</span> result = sqlite.execSql(sql);
    logd(<span class="hljs-string">&quot;execSql result&#xFF1A;&quot;</span>+ result);
}
main();
</code></pre>
</blockquote>
<h2 id="sqlitedropdatabase-&#x5220;&#x9664;&#x6570;&#x636E;&#x5E93;"><a name="sqlitedropdatabase-&#x5220;&#x9664;&#x6570;&#x636E;&#x5E93;" class="anchor-navigation-ex-anchor" href="#sqlitedropdatabase-&#x5220;&#x9664;&#x6570;&#x636E;&#x5E93;"><i class="fa fa-link" aria-hidden="true"></i></a>2.8. sqlite.dropDatabase &#x5220;&#x9664;&#x6570;&#x636E;&#x5E93;</h2>
<ul>
<li>&#x5220;&#x9664;&#x6570;&#x636E;&#x5E93;</li>
<li>@return boolean true &#x4EE3;&#x8868;&#x8BF7;&#x6C42;&#x6743;&#x9650;&#x6210;&#x529F;&#xFF0C;false&#x4EE3;&#x8868;&#x5931;&#x8D25;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>)</span>{
    <span class="hljs-keyword">var</span> result = sqlite.dropDatabase();
    logd(<span class="hljs-string">&quot;dropDatabase result&#xFF1A;&quot;</span>+ result);
}
main();
</code></pre>
</blockquote>
<h2 id="sqlitedroptable-&#x5220;&#x9664;&#x8868;"><a name="sqlitedroptable-&#x5220;&#x9664;&#x8868;" class="anchor-navigation-ex-anchor" href="#sqlitedroptable-&#x5220;&#x9664;&#x8868;"><i class="fa fa-link" aria-hidden="true"></i></a>2.9. sqlite.dropTable &#x5220;&#x9664;&#x8868;</h2>
<ul>
<li>&#x5220;&#x9664;&#x8868;
@param table &#x8868;&#x540D;</li>
<li>@return boolean true &#x4EE3;&#x8868;&#x8BF7;&#x6C42;&#x6743;&#x9650;&#x6210;&#x529F;&#xFF0C;false&#x4EE3;&#x8868;&#x5931;&#x8D25;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>)</span>{
    <span class="hljs-keyword">var</span> tableName=<span class="hljs-string">&quot;tbl_user&quot;</span>;
    <span class="hljs-keyword">var</span> result = sqlite.dropTable(tableName);
    logd(<span class="hljs-string">&quot;dropTable result&#xFF1A;&quot;</span>+ result);
}
main();
</code></pre>
</blockquote>
<h2 id="sqliteclose-&#x5173;&#x95ED;&#x6570;&#x636E;&#x5E93;&#x94FE;&#x63A5;&#xFF0C;&#x91CA;&#x653E;&#x8D44;&#x6E90;"><a name="sqliteclose-&#x5173;&#x95ED;&#x6570;&#x636E;&#x5E93;&#x94FE;&#x63A5;&#xFF0C;&#x91CA;&#x653E;&#x8D44;&#x6E90;" class="anchor-navigation-ex-anchor" href="#sqliteclose-&#x5173;&#x95ED;&#x6570;&#x636E;&#x5E93;&#x94FE;&#x63A5;&#xFF0C;&#x91CA;&#x653E;&#x8D44;&#x6E90;"><i class="fa fa-link" aria-hidden="true"></i></a>2.10. sqlite.close &#x5173;&#x95ED;&#x6570;&#x636E;&#x5E93;&#x94FE;&#x63A5;&#xFF0C;&#x91CA;&#x653E;&#x8D44;&#x6E90;</h2>
<ul>
<li>&#x5173;&#x95ED;&#x6570;&#x636E;&#x5E93;&#x94FE;&#x63A5;&#xFF0C;&#x91CA;&#x653E;&#x8D44;&#x6E90;</li>
<li>@return boolean true &#x4EE3;&#x8868;&#x8BF7;&#x6C42;&#x6743;&#x9650;&#x6210;&#x529F;&#xFF0C;false&#x4EE3;&#x8868;&#x5931;&#x8D25;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>)</span>{
    <span class="hljs-keyword">var</span> result = sqlite.close();
    logd(<span class="hljs-string">&quot;close result&#xFF1A;&quot;</span>+ result);
}
main();
</code></pre>
</blockquote>

<script>console.log("plugin-popup....");document.onclick = function(e){ e.target.tagName === "IMG" && window.open(e.target.src,e.target.src)}</script><style>img{cursor:pointer}</style>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="shell-api.html" class="navigation navigation-prev " aria-label="Previous page: Shell命令函数">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="ui-custom.html" class="navigation navigation-next " aria-label="Next page: 原生UI定制">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Sqlite命令函数","level":"1.7.13","depth":2,"next":{"title":"原生UI定制","level":"1.8","depth":1,"path":"zh-cn/funcs/ui-custom.md","ref":"zh-cn/funcs/ui-custom.md","articles":[{"title":"JS编写UI","level":"1.8.1","depth":2,"path":"zh-cn/funcs/ui-js-inter.md","ref":"zh-cn/funcs/ui-js-inter.md","articles":[]},{"title":"模板式UI","level":"1.8.2","depth":2,"path":"zh-cn/funcs/ui-js-template.md","ref":"zh-cn/funcs/ui-js-template.md","articles":[]},{"title":"原生UI控件","level":"1.8.3","depth":2,"path":"zh-cn/funcs/ui-native-view.md","ref":"zh-cn/funcs/ui-native-view.md","articles":[{"title":"LinearLayout线性布局","level":"1.8.3.1","depth":3,"path":"zh-cn/funcs/ui/linearlayout.md","ref":"zh-cn/funcs/ui/linearlayout.md","articles":[]},{"title":"FrameLayout帧布局","level":"1.8.3.2","depth":3,"path":"zh-cn/funcs/ui/framelayout.md","ref":"zh-cn/funcs/ui/framelayout.md","articles":[]},{"title":"RelativeLayout绝对布局","level":"1.8.3.3","depth":3,"path":"zh-cn/funcs/ui/relativelayout.md","ref":"zh-cn/funcs/ui/relativelayout.md","articles":[]},{"title":"ScrollView滚动框","level":"1.8.3.4","depth":3,"path":"zh-cn/funcs/ui/scrollview.md","ref":"zh-cn/funcs/ui/scrollview.md","articles":[]},{"title":"View视图","level":"1.8.3.5","depth":3,"path":"zh-cn/funcs/ui/view.md","ref":"zh-cn/funcs/ui/view.md","articles":[]},{"title":"Button按钮","level":"1.8.3.6","depth":3,"path":"zh-cn/funcs/ui/button.md","ref":"zh-cn/funcs/ui/button.md","articles":[]},{"title":"TextView文本","level":"1.8.3.7","depth":3,"path":"zh-cn/funcs/ui/textview.md","ref":"zh-cn/funcs/ui/textview.md","articles":[]},{"title":"EditText输入框","level":"1.8.3.8","depth":3,"path":"zh-cn/funcs/ui/edittext.md","ref":"zh-cn/funcs/ui/edittext.md","articles":[]},{"title":"CheckBox复选框","level":"1.8.3.9","depth":3,"path":"zh-cn/funcs/ui/checkbox.md","ref":"zh-cn/funcs/ui/checkbox.md","articles":[]},{"title":"RadioGroup布局","level":"1.8.3.10","depth":3,"path":"zh-cn/funcs/ui/radiogroup.md","ref":"zh-cn/funcs/ui/radiogroup.md","articles":[]},{"title":"RadioButton单选框","level":"1.8.3.11","depth":3,"path":"zh-cn/funcs/ui/radiobutton.md","ref":"zh-cn/funcs/ui/radiobutton.md","articles":[]},{"title":"Spinner下拉选择框","level":"1.8.3.12","depth":3,"path":"zh-cn/funcs/ui/spinner.md","ref":"zh-cn/funcs/ui/spinner.md","articles":[]},{"title":"WebView内嵌浏览器","level":"1.8.3.13","depth":3,"path":"zh-cn/funcs/ui/webview.md","ref":"zh-cn/funcs/ui/webview.md","articles":[]},{"title":"ImageView图像","level":"1.8.3.14","depth":3,"path":"zh-cn/funcs/ui/imageview.md","ref":"zh-cn/funcs/ui/imageview.md","articles":[]},{"title":"CardView卡片布局","level":"1.8.3.15","depth":3,"path":"zh-cn/funcs/ui/cardview.md","ref":"zh-cn/funcs/ui/cardview.md","articles":[]},{"title":"Swtich开关按钮","level":"1.8.3.16","depth":3,"path":"zh-cn/funcs/ui/switch.md","ref":"zh-cn/funcs/ui/switch.md","articles":[]}]}]},"previous":{"title":"Shell命令函数","level":"1.7.12","depth":2,"path":"zh-cn/funcs/shell-api.md","ref":"zh-cn/funcs/shell-api.md","articles":[]},"dir":"ltr"},"config":{"plugins":["chapter-fold","code","copy-code-button","-lunr","-search","search-pro","anchor-navigation-ex","hide-element","favicon-absolute","popup"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"chapter-fold":{},"search-pro":{},"popup":{},"code":{"copyButtons":true},"favicon-absolute":{"appleTouchIconMore":{},"appleTouchIconPrecomposed152":"/zh-cn/images/ico.png","appleTouchIconPrecomposedMore":{},"favicon":"/zh-cn/images/ico.png"},"hide-element":{"elements":[".gitbook-link"]},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":true,"showLevel":true},"copy-code-button":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"EasyClick开发文档","language":"zh-hans","gitbook":"*","description":"记录EasyClick开发教程和常用的函数"},"file":{"path":"zh-cn/funcs/sqlite-api.md","mtime":"2020-04-28T11:58:25.680Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-06-23T14:38:08.296Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-hide-element/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

